
console.log(process.env)
const DEVELOPMENT = {
    // baseUrl: 'https://dev-after-1346251-1307944531.ap-shanghai.run.tcloudbase.com'
    baseUrl: '/api'
}
const TEST = {
    baseUrl: 'http://192.168.1.110:8010'
}
const PRODUCTION = {
    baseUrl: ''
}
const  Intranet = false

export const httpConfig = () => {
    const ENV = process.env.VUE_APP_ENV
    let HTTP_CONFIG = { //默认参数
        FileUpload: (dir) => {// images audio uploadFile
            if(Intranet) return `http://192.168.1.110:6004/postFile?dir=${dir}`
            else return `http://192.168.1.110:6004/ossUpload/uploadFile?dir=${dir}`
        },
        ActivitiUrl: "http://192.168.1.110:8010",
        UploadClientUrl: (dir) => { // 客户端上传接口
            return `http://192.168.1.110:6004/upLoadFile?dir=${dir}`
        },
        ReadFile: 'http://192.168.1.110:7001/',   //下载
        SCROMReadUrl: 'http://192.168.1.110:7002/',
        SCROMuploadUrl: (dir) => `http://192.168.1.110:6004/postFileZip?dir=${dir}`,
        TemplateDownload:'http://192.168.1.111:7001/templateFolder',
    }
    switch(ENV) {
        case 'development': 
            HTTP_CONFIG = Object.assign({}, HTTP_CONFIG, DEVELOPMENT)
            break;
        case 'test': 
            HTTP_CONFIG = Object.assign({}, HTTP_CONFIG, TEST)
            break;
        case 'production': 
            HTTP_CONFIG = Object.assign({}, HTTP_CONFIG, PRODUCTION)
            break;
    }
    return HTTP_CONFIG
}